from django.db import models

# Create your models here.


class JiaoShi(models.Model):
    order_number = models.IntegerField(verbose_name='序号', max_length=8)
    cls_name = models.CharField(verbose_name='教室名称', max_length=16)
    number_people = models.IntegerField(verbose_name='人数', max_length=8)
    theory = models.BooleanField(verbose_name='是否理论教室')
    image = models.FileField(verbose_name='图片', upload_to='cls/')
    def gender(self):
        if self.theory == True:
            return '是'
        else:
            return '否'

    gender.short_description = '是否理论教室'

    def __str__(self):
        return "%d" % self.pk

    class Meta():
        verbose_name_plural = '教室管理'